<template>
	 <!-- 子传父 -->
	<view class="">
		<Emit @add="onAdd" @change="onChange"></Emit>
		<view class="box" :style="{background:color,fontSize:size+'px'}">
			num: {{num}}
		</view>
	</view>
</template>

<script setup>
	import {ref} from 'vue';
	
	const num = ref(0)
	const color = ref('#fff')
	const size = ref(12)
	
	const onAdd = (e)=>{
		console.log(e)
		num.value = e;
		color.value = '#' + String(e).substring(3,6)
	}
	
	const onChange = function(e){
		console.log(e);
		size.value = e;
	}

</script>

<style lang="scss" scoped>

</style>
